const { src, dest, watch } = require("gulp");
const sass = require('gulp-sass')(require('sass'));
const connect = require("gulp-connect");

exports.server = function () {
    connect.server({
        root: "./www",
        port: 3333,
    })
}

function sassFn() {
    return src('./www/sass/*.scss')
        .pipe(sass().on('error', sass.logError))
        .pipe(dest('./www/css'));
}
exports.sass = sassFn

exports.watch = function (cb) {
    watch('./www/sass/*.scss', sassFn);
    cb()
};